<?php

namespace App\Entities;

use Illuminate\Database\Eloquent\Model;

class CouponCodeModel extends Model
{
    protected $table = 'coupon_codes';

    public const COUPON_UNUSED = 0;
    public const COUPON_USED = 1;  // 优惠券已使用

    public const COUPON_UNENABLE = 0;
    public const COUPON_ENABLED = 1;  // 可以使用

    // 用常量的方式定义支持的优惠券类型
    public const TYPE_FIXED = 'fixed';
    public const TYPE_PERCENT = 'percent';

    public const ENABLED = 1; // 优惠券可以使用

    public static $typeMap = [
        self::TYPE_FIXED   => '满减',
        self::TYPE_PERCENT => '打折',
    ];
}
